/*
 * ScreenUI.c
 *
 *  Created on: Jun 1, 2021
 *      Author: user
 */

#include "ScreenUI.h"
#include "Screen.h"
#include "Fire.h"

void displayFireGradePic(float resistance)
{
	uint16_t resistance_uint;
	if (resistance > 0 && resistance < 11.0)
	{
		resistance_uint = 11 - (uint16_t) (resistance);
		displayIcon(PIC_ADDR, resistance_uint);
	}
	else
	{
		displayIcon(PIC_ADDR, (0x0000U));
	}
}

void RefreshScreen(void)
{
	float resistance;
	resistance = getResistance();
	displayNum(Resistance_ADDR, resistance);
	displayFireGradePic(resistance);
}

